package com.team.abs.controller;

import java.util.Date;
import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.team.abs.dao.opinionImpl;

@Controller
@RequestMapping("/pipiandpop")
public class opinioncontroller {

	@Autowired
	private opinionImpl op;
	
	@RequestMapping(value="/opinion",method=RequestMethod.POST)
	public ResponseEntity<String>opinion_upload(
			@RequestParam(value="opinion")String opinion){
		System.out.println(opinion);
		Map<String,Object>map=new HashMap<>();
		map.put("opinion",opinion);
		map.put("opinion_time",new Timestamp(new Date().getTime()));
		op.opinion_insert(map);
		
		return ResponseEntity.ok("ok");
	}
}
